//
//  SearchView.m
//  Wujin
//
//  Created by cz on 2016/12/9.
//  Copyright © 2016年 dong. All rights reserved.
//

#import "SearchView.h"
@interface SearchView ()<UITextFieldDelegate>

@end

@implementation SearchView

- (IBAction)searchBtnClick {
    DLog(@"搜索");
    //通知代理办事
    if ([self.delegate respondsToSelector:@selector(searchButtonDidClicked)]) {
        [self.delegate searchButtonDidClicked];
    }    
}


- (IBAction)cancelBtnClick {
    DLog(@"取消");
    //通知代理办事
    if ([self.delegate respondsToSelector:@selector(cancelButtonDidClicked)]) {
        [self.delegate cancelButtonDidClicked];
    }
    //从父视图移除
    [self removeFromSuperview];
    
}

/**
  重写方法，重新设置frame
 */
- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        
        
    }
    return self;
}

- (void)setFrame:(CGRect)frame {
    
    [super setFrame:CGRectMake(0, 0, SCREENBOUNDS.width, 44)];
    
}


+ (instancetype)setupSearchView {
    
    SearchView *view = [[[NSBundle mainBundle] loadNibNamed:@"SearchView" owner:nil options:nil] lastObject];
    
    return view;
}

@end
